<?php
  include_once 'global.php';
  //echo md5('888888');
  if($_POST['user_name']==$myinfo['user_name']&&md5($_POST['user_pwd'])==$myinfo['user_pwd']){
  	//setcookie('user_name',$myinfo['user_name']);
  	//setcookie('user_pwd',$myinfo['user_pwd']);
  	$_SESSION['user_name']=$myinfo['user_name'];
  	$_SESSION['user_pwd']=$myinfo['user_pwd'];
  	echo "<script>alert('登录成功！');location.href='index.php'</script>";
  	
  }
  $o = new WeiboOAuth( WB_AKEY , WB_SKEY  );
  $keys = $o->getRequestToken();
  $aurl = $o->getAuthorizeURL( $keys['oauth_token'] ,false ,$url_path.'/callback.php');
  $_SESSION['keys'] = $keys;
  $smarty->assign('aurl',$aurl);
  $smarty->display('login.html');
?>